package com.beidasoft.web.util.enums;

/**
 * @Author songff
 * @MethodName
 * @Description //TODO 检查单类型枚举类
 * @Date 11:23 2020/3/28
 * @Param
 * @return 检查 -转- 处罚
 * 1 日常检查 0
 * 2 专项检查 2
 * 9其他 4
 **/
public enum CheckTypeEnum {

    CHECK_TYPE_1("1", "0", "日常检查"),
    CHECK_TYPE_2("2", "2", "专项检查"),
    CHECK_TYPE_9("9", "4", "其他");

    private String code;//检查代码值
    private String type;//处罚代码值
    private String name;

    CheckTypeEnum(String code, String type, String name) {
        this.code = code;
        this.type = type;
        this.name = name;
    }

    /**
     * @return
     * @Author songff
     * @MethodName
     * @Description //TODO 通过检查的检查单分类代码值获取处罚的检查单分类代码值
     * @Date 11:25 2020/3/28
     * @Param
     **/
    public static String getTypeByCode(String code) {
        switch (code) {
            case "1":
                return CHECK_TYPE_1.type;
            case "2":
                return CHECK_TYPE_2.type;
            case "9":
                return CHECK_TYPE_9.type;
            default:
                return null;
        }
    }

    /**
     * @return
     * @Author songff
     * @MethodName
     * @Description //TODO 通过处罚的检查单分类代码值获取检查的检查单分类代码值
     * @Date 11:25 2020/3/28
     * @Param
     **/
    public static String getCodeByName(String type) {
        switch (type) {
            case "0":
                return CHECK_TYPE_1.code;
            case "2":
                return CHECK_TYPE_2.code;
            case "4":
                return CHECK_TYPE_9.code;
            default:
                return null;
        }
    }
}
